package cc.ctech.course.spring.web;

import cc.ctech.course.spring.service.AddOperation;
import cc.ctech.course.spring.service.SubOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author +VX: ramon_chi
 */

@RestController
public class OperateController {
    @Autowired
    private AddOperation addOperation;
    @Autowired
    private SubOperation subOperation;

    @GetMapping("add")
    public Object add() {
        return addOperation.add(1, 2);
    }

    @GetMapping("sub")
    public Object sub() {
        return subOperation.sub(5, 1);
    }
}
